﻿using Dapper.Sharding;
using Test2;

namespace Model
{
    public class DbContext
    {
        public IClient Client { get; }

        public string DbName { get; }

        public IDatabase Db => Client.GetDatabase(DbName);

        public DbContext(IClient client, string dbName)
        {
            Client = client;
            DbName = dbName;
        }

        public ITable<AA> People => Db.GetTable<AA>("people");

        public ITable<BB> Zsss12 => Db.GetTable<BB>("zsss12");
    }

    public class AAAAAA
    {
        public void A()
        {
            var ctx = new DbContext(DbHelper.Client, "asda");
        }
    }
}